package com.sanjin.tinyspring.mvc.test.controller;

import com.sanjin.tinyspring.core.annotation.Autowired;
import com.sanjin.tinyspring.core.annotation.Controller;
import com.sanjin.tinyspring.core.annotation.RequestMapping;
import com.sanjin.tinyspring.core.annotation.RequestParam;
import com.sanjin.tinyspring.mvc.test.service.Action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author: jiangxch
 * @date: 2019/11/26 9:54
 */
@Controller("/demo")
public class DemoController {

    @Autowired
    private Action action;


    @RequestMapping("/tinyspring")
    public String hello(@RequestParam("username") String username, HttpServletRequest req, HttpServletResponse resp) {
        System.out.println(action.sayHi("草泥马"));
        return "hello," + username;
    }
}
